﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<HYBYSoft.Company.Models.QuestionAndReplyMessages>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <div id="div_list">
            <%if (Model.Count() == 0)
              {
                  Html.RenderPartial("partialNoneDate");
              }
              else
              {
                  var grid = new WebGrid(source: Model, defaultSort: "CreateTime", rowsPerPage: 10, canSort: false);%>
            <%=grid.GetHtml(tableStyle: "grid", headerStyle: "header", footerStyle: "footer", rowStyle: "row", alternatingRowStyle: "alt", mode: WebGridPagerModes.All, firstText: "首页", previousText: "上一页", nextText: "下一页", lastText: "末页", columns: grid.Columns(grid.Column("留言标题", format: (item) => Html.ActionLink(((QuestionAndReplyMessages)((WebGridRow)item).Value).Titles.Length > 20 ? ((QuestionAndReplyMessages)((WebGridRow)item).Value).Titles.Substring(0, 20) : ((QuestionAndReplyMessages)((WebGridRow)item).Value).Titles, "Details", new { id = item.QuestionID }, ((QuestionAndReplyMessages)((WebGridRow)item).Value))),
                            grid.Column("CreateTime", "创建时间", style: "timecolumn"),
                            grid.Column("LastReplyTime", "最后回复时间", style: "timecolumn"),
                            grid.Column("是否回复", format: (item) => Html.Encode(((QuestionAndReplyMessages)((WebGridRow)item).Value).IsReply == 1 ? "已回复" : "未回复"), style: "isreply")
            ))%>        
        <% }%>
        </div>
    <p>
        <%: Html.ActionLink("新增留言", "Create") %>
    </p>
</asp:Content>
